package com.zhiyinlou.apps.page.base;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;

import com.zhiyinlou.apps.util.file.ParsePropertiesUtil;



public class BasePage {
	
	public static Logger logger = LogManager.getLogger(BasePage.class);
	
	protected Screen s;
	protected String filepath;
	
	public BasePage() {
		s = new Screen();
		filepath=ParsePropertiesUtil.getInstance().getProperty("filepath_img");
	}
	
	public void sleep(long t) {
		try {
			Thread.sleep(t);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
	//点击
	public void click(String imgpath) {
		try {
			s.click(imgpath);
		} catch (FindFailed e) {
			e.printStackTrace();
		}
	}
	//双击
	public void douclick(String imgpath) {
		try {
			s.doubleClick(imgpath);
		} catch (FindFailed e) {
			e.printStackTrace();
		}
	}

	//输入
	public void type(String imgpath,String text) {
		s.type(imgpath, text);
	}
	
	
	
}
